-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sockets - Erica #23
base: master
Are you sure you want to change the base?
Sockets - Erica #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done, you hit the major learning goals here. Take a look at my comments and let me know if you have any questions.
# Time Complexity: | ||
# Space Complexity | ||
# Time Complexity: O(n), where n is the length of the list | ||
# Space Complexity: ?? I'm not sure if puts counts as using memory. If it does, then O(n), where n is the length of the list. Otherwise O(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't, the output goes to the screen and is forgotten.
def find_middle_value | ||
raise NotImplementedError | ||
return self.get_at_index(self.length / 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smart!
def find_nth_from_end(n) | ||
raise NotImplementedError | ||
largest_index = self.length - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use get_at_index
again?
def insert_ascending(value) | ||
raise NotImplementedError | ||
add_first(value) if @head == nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right, you would end up inserting value into the list multiple times.
No description provided.